home *** CD-ROM | disk | FTP | other *** search
- ; -----------------------------------------------------
- ; Peace and Protection (by misspai)
- ; -----------------------------------------------------
- ; Configurations (part 1)
- ; -----------------------------------------------------
- ; Protection settings editor
- ; -----------------------------------------------------
- protedit {
- window -c @Protection
- if (($1 != $null) && ($_not($_ischan($1)))) _error You can only edit protection settings for channels (or global if you don't specify a channel)
- window -lar $_tabscale(21,46,52,58,64,70,76,82,88,94,100) @Protection 0 0 $window(-3).w $window(-3).h @Protection %font.basic
- if ($1 == $null) {
- titlebar @Protection settings (global $+ $chr(160) $+ / $+ $chr(160) $+ default)
- aline @Protection - Double-click to edit setting or option; Right-click for options -
- }
- else {
- titlebar @Protection settings for $1
- aline @Protection - Double-click to edit setting or option; Right-click for options - %col.addr $+ [default] means global setting for all channels
- }
- set %_prot.ini $_ppdir $+ protedit.ini
- aline @Protection $chr(160)
- aline @Protection Protection Activates on Action sequence
- set %_prot.bar 100
- set %.pe.max $readini -n %_prot.ini protis num
- set %.pe.num 1
- :loop1
- _pdispl %.pe.num $1
- if ($_vi(.pe.num) <= %.pe.max) goto loop1
- window -b @Protection
- }
- _pdispl {
- set %.pe.is $readini -n %_prot.ini protis $1
- if (%.pe.is == -) { aline @Protection $chr(160) | return }
- if (%.pe.is == *) { aline @Protection Feature Setting | set %_prot.bar $1 | return }
- set %.pe.post $gettok(%.pe.is,1,32)
- set %.pe.is $gettok(%.pe.is,2-,32)
- set %.pe.pre $readini -n %_prot.ini protset %.pe.post
- set %.pe.pren $_numtok(32,%.pe.pre)
- set %.pe.prenc 1
- unset %.+pe.def
- :loop2
- set %.pe.get $gettok(%.pe.pre,%.pe.prenc,32) $+ %.pe.post
- if ($2 == $null) set %.pe. [ $+ [ %.pe.prenc ] ] % [ $+ [ %.pe.get ] ]
- else {
- set %.pe.get2 %.pe.get $+ . $+ $2
- set %.pe.got % [ $+ [ %.pe.get2 ] ]
- if (%.pe.got == $null) {
- set %.+pe.def $true
- set %.pe. [ $+ [ %.pe.prenc ] ] % [ $+ [ %.pe.get ] ]
- }
- else set %.pe. [ $+ [ %.pe.prenc ] ] %.pe.got
- }
- if ($_vi(.pe.prenc) <= %.pe.pren) goto loop2
- if ((%.pe.1 == $true) || (%.pe.1 == on)) set %.pe.text %col.info1 $+ [enabled]
- elseif ((%.pe.1 == 0) || (%.pe.1 == $null) || (%.pe.1 == $false) || (%.pe.1 == off)) set %.pe.text %col.att $+ [disabled]
- elseif (%.+pe.def) set %.pe.text $readini -n %_prot.ini protmin %.pe.post
- else set %.pe.text $readini -n %_prot.ini protact %.pe.post
- if (%.+pe.def) set %.pe.text %col.addr $+ [default]á %.pe.text
- :loop3
- set %.pe.rep1 & $+ %.pe.pren $+ &
- set %.pe.repw %col.target $+ %.pe. [ $+ [ %.pe.pren ] ] $+
- set %.pe.text $replace(%.pe.text,%.pe.rep1,%.pe.repw)
- if ($_vd(.pe.pren) > 0) goto loop3
- unset %.+pe.def
- set %.pe.get action1. $+ %.pe.post
- if ($2 == $null) set %.pe.act % [ $+ [ %.pe.get ] ]
- else {
- set %.pe.get22 %.pe.get $+ . $+ $2
- set %.pe.act % [ $+ [ %.pe.get22 ] ]
- if (%.pe.act == $null) {
- set %.+pe.def $true
- set %.pe.act % [ $+ [ %.pe.get ] ]
- }
- }
- if (%.pe.pad1 > 18) unset %.pe.act
- else {
- set %.pe.act %col.target $+ %.pe.act $+
- set %.pe.actn 2
- :loop4
- set %.pe.get action $+ %.pe.actn $+ . $+ %.pe.post
- if ($2 != $null) if (%.+pe.def == $false) set %.pe.get %.pe.get $+ . $+ $2
- set %.pe.got % [ $+ [ %.pe.get ] ]
- if (%.pe.got != $null) {
- set %.pe.act %.pe.act , $+ %col.target $+ %.pe.got $+
- inc %.pe.actn
- goto loop4
- }
- if (%.+pe.def) set %.pe.act %col.addr $+ [default] $+ %.pe.act
- }
- if ($1 > %_prot.bar) rline @Protection $calc($1 + 3) %.pe.is $+ $+ %.pe.text
- else rline @Protection $calc($1 + 3) %.pe.is $+ $+ %.pe.text $+ $+ %.pe.act
- }
- _peditl {
- if ($1 < 4) return
- set %.line $calc($1 - 3)
- set %_prot.line $1
- set %.is $readini -n %_prot.ini protis %.line
- if (%.is isin -*) return
- set %_prot.post $gettok(%.is,1,32)
- set %_prot.pre $readini -n %_prot.ini protset %_prot.post
- set %.chan $gettok($window(@Protection).titlebar,3,32)
- if (%.chan != $null) set %.chan . $+ %.chan
- set %_prot.chan %.chan
- if ($1 > $_i(%_prot.bar)) {
- set %.var %_prot.pre $+ %_prot.post
- set %.name $readini -n %_prot.ini protset %.var
- set %.bit $left(%.name,1)
- set %.var %.var $+ %.chan
- set %.value % [ $+ [ %.var ] ]
- if ($2 == ) {
- if (%.chan == $null) set % [ $+ [ %.var ] ] $readini -n %_prot.ini default %.var
- else set % [ $+ [ %.var ] ]
- }
- elseif (%.bit == N) {
- if (($2 == $null) || ($2 !isnum)) { set %_arhelp _peditl $1 | _pentry _arhelp $+ $_s2p(%.value) $_rchop(1,%.name) }
- set % [ $+ [ %.var ] ] $2
- }
- elseif (%.bit == S) {
- if ($2 == $null) {
- window -c @WhoisOnJoin
- window -l @WhoisOnJoin $_winpos(35%,35%,28%,28%) /_wsetclk @WhoisOnJoin %font.basic
- aline @WhoisOnJoin - Double-click on when you want to whois users -
- aline @WhoisOnJoin $chr(160)
- aline @WhoisOnJoin Don't whois users automatically
- aline @WhoisOnJoin Whois users when they join, if you are opped
- aline @WhoisOnJoin Always whois users when they join channel
- set %_prot.whois $1
- halt
- }
- if ($2 == $chr(160)) set % [ $+ [ %.var ] ] off
- else set % [ $+ [ %.var ] ] $2
- }
- elseif ($2 == $chr(160)) set % [ $+ [ %.var ] ] $false
- else set % [ $+ [ %.var ] ] $_not(%.value)
- if (%_prot.chan == $null) _pdispl %.line
- else _pdispl %.line $_rchop(1,%_prot.chan)
- return
- }
- elseif ($2 == ) {
- window -c @Setting
- set %_prot.ln6 A
- _psetclk A
- return
- }
- elseif ($2 == $chr(160)) {
- window -c @Setting
- set %_prot.ln5 B
- _psetclk B
- return
- }
- set %.is $gettok(%.is,2-,32)
- window -c @Setting
- window -l $_tabscale(7) @Setting $_winpos(20%,20%,7%,7%) @Setting %font.basic
- titlebar @Setting - %.is
- aline @Setting %col.dark $+ Protection triggers- (double-click to edit)
- set %.pren $_numtok(32,%_prot.pre)
- set %.prec 1
- :loop1
- set %.var $gettok(%_prot.pre,%.prec,32) $+ %_prot.post
- set %.name $readini -n %_prot.ini protset %.var
- set %.bit $left(%.name,1)
- set %.var %.var $+ %.chan
- set %.value % [ $+ [ %.var ] ]
- if (%.value == $null) {
- if (%.chan == $null) set %.value %col.att $+ [disabled]
- else set %.value %col.addr $+ (global default)
- }
- elseif (%.value == $true) set %.value %col.info1 $+ [enabled]
- elseif ((%.value == $false) || (%.value == 0)) set %.value %col.att $+ [disabled]
- else set %.value %col.target $+ %.value
- aline @Setting $_rchop(1,%.name) - %.value
- if ($_vi(.prec) <= %.pren) goto loop1
- set %_prot.ln1 $line(@Setting,0)
- aline @Setting $chr(160)
- aline @Setting %col.dark $+ Action sequence- (double-click to edit, right-click to delete an action)
- set %.var action1. $+ %_prot.post $+ %.chan
- if (% [ $+ [ %.var ] ] == $null) {
- aline @Setting ò %col.addr $+ (global default)
- set %_prot.ln2 $line(@Setting,0)
- set %_prot.ln3 %_prot.ln2
- set %_prot.ln4 %_prot.ln2
- set %_prot.add 1
- }
- else {
- set %_prot.ln2 $_i($line(@Setting,0))
- set %.prec 1
- :loop2
- set %.var action $+ %.prec $+ . $+ %_prot.post $+ %.chan
- set %.act % [ $+ [ %.var ] ]
- if (%.act != $null) {
- set %.km $readini -n %_prot.ini msg %_prot.post
- if (%.prec > 1) set %.km %.km $+ %.prec
- set %.msg $_ppcfg(Kicks,%.km)
- if (%.msg == $null) set %.msg $_ppdef(Kicks,%.km)
- aline @Setting ò $_s2f(%.act) $+ " $+ %.msg $+ "
- inc %.prec
- goto loop2
- }
- set %_prot.ln3 $line(@Setting,0)
- aline @Setting ò %col.dark $+ (add an action)
- set %_prot.ln4 $line(@Setting,0)
- set %_prot.add %.prec
- }
- aline @Setting $chr(160)
- aline @Setting %col.dark $+ - Double-click here to disable this protection -
- set %_prot.ln5 $line(@Setting,0)
- if (%.chan == $null) aline @Setting %col.dark $+ - Double-click here for default settings -
- else aline @Setting %col.dark $+ - Double-click here for global default settings -
- set %_prot.ln6 $line(@Setting,0)
- aline @Setting $chr(160)
- aline @Setting &codes& supported by these messages- (see help for details)
- aline %col.base @Setting - $readini -n %_prot.ini c0 all
- aline %col.base @Setting - $readini -n %_prot.ini c1 %_prot.post
- aline %col.base @Setting - $readini -n %_prot.ini c2 %_prot.post
- }
- _psetclk {
- if (($1 >= 2) && ($1 <= %_prot.ln1)) {
- set %.var $gettok(%_prot.pre,$_j($1),32) $+ %_prot.post
- set %.name $readini -n %_prot.ini protset %.var
- set %.bit $left(%.name,1)
- set %.var %.var $+ %_prot.chan
- set %.value % [ $+ [ %.var ] ]
- if (%.bit == O) set % [ $+ [ %.var ] ] $_not(%.value)
- elseif (%.bit == N) {
- if (($2 == $null) || ($2 !isnum)) { set %_arhelp _psetclk $1 | _pentry _arhelp $+ $_s2p(%.value) $_rchop(1,%.name) }
- set % [ $+ [ %.var ] ] $2
- }
- elseif (%.bit == S) {
- if ($2 == $null) {
- window -c @Revolve
- window -l @Revolve $_winpos(28%,28%,26%,26%) @Revolve %font.basic
- aline @Revolve - Double-click on what you want to be counted as revolves -
- aline @Revolve $chr(160)
- aline @Revolve part
- aline @Revolve join
- aline @Revolve part/join
- aline @Revolve kick
- aline @Revolve kick/part
- aline @Revolve kick/join
- aline @Revolve kick/part/join
- halt
- }
- set % [ $+ [ %.var ] ] $2
- }
- else {
- if ($2 == $null) {
- window -c @ListSetting
- window -l @ListSetting $_winpos(19%,19%,26%,26%) @ListSetting %font.basic
- aline @ListSetting - Double-click to modify an entry, right-click to delete an entry -
- aline @ListSetting $chr(160)
- set %_prot.value %.value
- set %.nm $_numtok(32,%.value)
- if (%.nm > 0) {
- set %.cr 1
- :loopie
- aline @ListSetting $gettok(%.value,%.cr,32)
- if ($_vi(.cr) <= %.nm) goto loopie
- }
- aline @ListSetting (addánewáentry)
- halt
- }
- set % [ $+ [ %.var ] ] $3-
- }
- set %.value % [ $+ [ %.var ] ]
- if (%.value == $null) {
- if (%.chan == $null) set %.value %col.att $+ [disabled]
- else set %.value %col.addr $+ (global default)
- }
- elseif (%.value == $true) set %.value %col.info1 $+ [enabled]
- elseif ((%.value == $false) || (%.value == 0)) set %.value %col.att $+ [disabled]
- else set %.value %col.target $+ %.value
- rline @Setting $1 $_rchop(1,%.name) - %.value
- }
- elseif (($1 >= %_prot.ln2) && ($1 <= %_prot.ln4)) {
- if ($2 == $null) {
- window -c @Actions
- window -l @Actions $_winpos(16%,16%,35%,35%) @Actions %font.basic
- aline @Actions - Double-click to select an action -
- aline @Actions %=
- aline @Actions warn (warning via notice)
- aline @Actions kick (kick)
- aline @Actions tempban (20 second ban)
- aline @Actions kb (kickban)
- aline @Actions kb0 (kickban ip)
- aline @Actions kb2 (kickban domain)
- aline @Actions cb (cloneban)
- aline @Actions cb0 (cloneban ip)
- aline @Actions cb2 (cloneban domain)
- aline @Actions deop (deop)
- aline @Actions fk (filterkick clones)
- aline @Actions fknop (filterkick non-opped clones)
- aline @Actions (custom)
- if ($1 < %_prot.ln4) {
- set %.old $strip($gettok($line(@Setting,$1),2,32))
- set %.old $findtok(warn.kick.tempban.kb.kb0.kb2.cb.cb0.cb2.deop.fk.fknop,%.old,46)
- if (%.old < 1) set %.old 15
- else inc %.old 2
- sline @Actions %.old
- }
- set %_prot.ln $1
- halt
- }
- if (($2 != $chr(160)) && ($3 == $null)) {
- set %_prot.km $readini -n %_prot.ini msg %_prot.post
- set %.kmn $calc($1 - %_prot.ln2 + 1)
- if (%.kmn > 1) set %_prot.km %_prot.km $+ %.kmn
- set %.msg $_ppcfg(Kicks,%_prot.km)
- if (%.msg == $null) set %.msg $_ppdef(Kicks,%_prot.km)
- set %_arhelp _psetclk $1 $2
- _pentry _arhelp $+ $_s2p(%.msg) Message to go with action?(note that action messages are not channel-specific)
- }
- if ($1 == %_prot.ln4) {
- set %.var action $+ %_prot.add $+ . $+ %_prot.post $+ %_prot.chan
- set % [ $+ [ %.var ] ] $_f2s($2)
- _writecfg Kicks %_prot.km $3-
- rline @Setting %_prot.ln4 ò %col.dark $+ (add an action)
- iline @Setting %_prot.ln4 ò $2 $+ " $+ $3- $+ "
- inc %_prot.add | inc %_prot.ln6 | inc %_prot.ln5 | inc %_prot.ln4 | inc %_prot.ln3
- }
- else {
- set %.num $calc($1 - %_prot.ln2 + 1)
- if ($2 == $chr(160)) {
- dline @Setting $1
- set %.num2 $_i(%.num)
- set %.km $readini -n %_prot.ini msg %_prot.post
- :loopde
- set %.var action $+ %.num $+ . $+ %_prot.post $+ %_prot.chan
- if (%.num > 1) set %.kmn %.km $+ %.num
- else set %.kmn %.km
- if (%.num2 == %_prot.add) { set % [ $+ [ %.var ] ] | _remcfg Kicks %.kmn }
- else {
- set %.var2 action $+ %.num2 $+ . $+ %_prot.post $+ %_prot.chan
- set %.km2 %.km $+ %.num2
- set % [ $+ [ %.var ] ] % [ $+ [ %.var2 ] ]
- _writecfg Kicks %.kmn $_ppcfg(Kicks,%.km2)
- inc %.num | inc %.num2 | goto loopde
- }
- dec %_prot.add | dec %_prot.ln6 | dec %_prot.ln5 | dec %_prot.ln4 | dec %_prot.ln3
- }
- else {
- set %.var action $+ %.num $+ . $+ %_prot.post $+ %_prot.chan
- set % [ $+ [ %.var ] ] $_f2s($2)
- _writecfg Kicks %_prot.km $3-
- rline @Setting $1 ò $2 $+ " $+ $3- $+ "
- }
- }
- }
- elseif ($1 == %_prot.ln5) {
- set %.var $gettok(%_prot.pre,1,32) $+ %_prot.post
- set %.name $readini -n %_prot.ini protset %.var
- set %.bit $left(%.name,1)
- set %.var %.var $+ %_prot.chan
- if (%.bit == N) {
- set % [ $+ [ %.var ] ] 0
- if (%.var == max.clone) set %warn.clone 0
- }
- elseif (%.bit == L) set % [ $+ [ %.var ] ] $null
- else set % [ $+ [ %.var ] ] $false
- if ($_isopen(@Setting)) rline @Setting 2 $_rchop(1,%.name) - %col.att $+ [disabled]
- }
- elseif ($1 == %_prot.ln6) {
- if (%_prot.chan == $null) {
- set %.nm $_numtok(32,%_prot.pre)
- :Crash
- set %.var $gettok(%_prot.pre,%.nm,32) $+ %_prot.post
- set % [ $+ [ %.var ] ] $readini -n %_prot.ini default %.var
- if ($_vd(.nm) > 0) goto crash
- set %.var action*. $+ %_prot.post
- [ unset % $+ [ %.var ] ]
- set %.acts $readini -n %_prot.ini default %.var
- set %.nm $_numtok(32,%.acts)
- set %.km $readini -n %_prot.ini msg %_prot.post
- :Test
- set %.var action $+ %.nm $+ . $+ %_prot.post
- set % [ $+ [ %.var ] ] $gettok(%.acts,%.nm,32)
- if (%.nm > 1) set %.kmn %.km $+ %.nm
- else set %.kmn %.km
- _remcfg Kicks %.kmn
- if ($_vd(.nm) > 0) goto test
- if ($_isopen(@Setting)) _peditl %_prot.line
- }
- else {
- set %.nm $_numtok(32,%_prot.pre)
- :Dummies
- set %.var $gettok(%_prot.pre,%.nm,32) $+ %_prot.post $+ %_prot.chan
- set % [ $+ [ %.var ] ]
- if ($_vd(.nm) > 0) goto dummies
- set %.var action*. $+ %_prot.post $+ %_prot.chan
- [ unset % $+ [ %.var ] ]
- window -c @Setting
- }
- }
- if (%_prot.chan == $null) _pdispl $calc(%_prot.line - 3)
- else _pdispl $calc(%_prot.line - 3) $_rchop(1,%_prot.chan)
- }
- _asetclk {
- if ($sline(@Actions,1).ln < 3) return
- set %.act $strip($gettok($sline(@Actions,1),1,32))
- if (custom isin %.act) set %.act $_s2f($1-)
- if (%.act == $null) _askr _asetclk Command to perform for action?
- window -c @Actions
- _psetclk %_prot.ln %.act
- }
- _rsetclk {
- if ($sline(@Revolve,1).ln < 3) return
- set %.ln $sline(@Revolve,1)
- window -c @Revolve
- _psetclk 3 $strip(%.ln)
- }
- _wsetclk {
- set %.ln $sline(@WhoisOnJoin,1).ln
- if (%.ln < 3) return
- window -c @WhoisOnJoin
- if (%.ln == 3) set %.ln Off
- elseif (%.ln == 4) set %.ln Op
- else set %.ln On
- _peditl %_prot.whois %.ln
- }
- _lsetclk {
- if ($1 < 3) return
- set %.it $line(@ListSetting,$1)
- if ($2 == $null) {
- set %_arhelp _lsetclk $1
- if ($1 == $line(@ListSetting,0)) _askr _arhelp New entry to add? (wildcards are ok)
- else _pentry _arhelp $+ $line(@ListSetting,$1) New entry? (wildcards are ok)
- }
- if ($1 == $line(@ListSetting,0)) {
- if ($2 == $chr(160)) return
- iline @ListSetting $1 $2
- if (%_prot.value == $null) set %_prot.value $2
- else set %_prot.value %_prot.value $2
- }
- else {
- if ($2 == $chr(160)) {
- dline @ListSetting $1
- set %_prot.value $remtok(%_prot.value,%.it,32)
- }
- else {
- rline @ListSetting $1 $2
- set %_prot.value $reptok(%_prot.value,%.it,$2,32)
- }
- }
- _psetclk 2 ! %_prot.value
- }
- ; -----------------------------------------------------
- ; Standard configuration editor
- ; -----------------------------------------------------
- config if ($1 == $null) _config topics | else _config $1-
- _config {
- if ($1 == ?) set %_c.sft $2 | else set %_c.sft *
- if ($1 == msg) { set %_condef1 Basic default | set %_condef2 Fancy default }
- else { set %_condef1 Default | unset %_condef2 }
- window -c @Config
- set %_c.line1 $left(%=,35) $+
- set %_c.line2 $right(%=,35)
- if ( isin %_c.line2) set %_c.line2 $+ $gettok(%_c.line2,2-,3)
- window -l @Config $_winpos(3%,3%,1%,1%) @Config %font.basic
- set %_c.file $_ppdir $+ configs.ini
- titlebar @Config - $readini -n %_c.file $1 is
- aline @Config (double-click to select/edit, right-click for default)
- set %.c.num $readini -n %_c.file $1 num
- set %.c.cur 1
- :loop
- set %.c.add $readini -n %_c.file $1 %.c.cur
- set %.c.add $replace(%.c.add,*,%_c.sft)
- aline @Config $_condisp(%.c.add)
- if ($_vi(.c.cur) <= %.c.num) goto loop
- set %_c.topic $1
- if (($2 != $null) && ($1 != ?)) _consel $2
- window -b @Config
- }
- _condisp {
- if (($1 == ?S) || ($1 == ?Z) || ($1 == ?X)) return $3- - %col.target $+ $_conval($2)
- set %.x.bit $left($1,1)
- if (%.x.bit == -) { if ($3 == -) return %= | return %_c.line1 %col.dark $+ $3- $+ %_c.line2 }
- set %.x.ret $3- - $remove(%col.target,) $+
- if ($1 == ?F) {
- if (%max.ver == 1) return %.x.ret $+ Tight CTCP flood protection
- if (%max.ver == 2) return %.x.ret $+ Normal CTCP flood protection
- if (%max.ver <= 4) return %.x.ret $+ Low CTCP flood protection
- return %.x.ret $+ No CTCP flood protection
- }
- if (%.x.bit isin ?M) return > $3- <
- if (%.x.bit isin YN) {
- if ($_conval($2)) return %.x.ret $+ $remove(%col.info1,) $+ Yes
- return %.x.ret $+ $remove(%col.att,) $+ No
- }
- if (%.x.bit == O) {
- if ($_conval($2)) return %.x.ret $+ $remove(%col.info1,) $+ On
- return %.x.ret $+ $remove(%col.att,) $+ Off
- }
- if ((%.x.bit == T) || (%.x.bit isnum)) {
- set %.x.val $_conval($2)
- if ((%.x.val == $null) || (%.x.val == 0)) return %.x.ret $+ $remove(%col.att,) $+ %.x.val
- return %.x.ret $+ %.x.val
- }
- if (%.x.bit == L) return %.x.ret $+ $readini -n %_c.file $2 $_iniprep($_conval($2))
- if (%.x.bit == K) {
- set %.x.val $_conval($2)
- return %.x.ret $+ $+ %.x.val $+ $_col2text(%.x.val)
- }
- if (%.x.bit == Z) {
- set %.x.val $_conval($2)
- if ($left(%.x.val,8) == !Random:) return %.x.ret $+ Random selection from file: $gettok(%.x.val,2-,58)
- return $3- $remove(%col.target,) $+ -> %.x.val
- }
- return %.x.ret $+ $readini -n %_c.file dcc $_iniprep($_conval($2))
- }
- _conval {
- if ($1 == ?) return $replace(%soundfile.custom,$chr(32),;)
- set %.cv.bit $left($1,1)
- if (%.cv.bit == $chr(35)) return $_o2tf($group($1))
- elseif (%.cv.bit == [) return $_ppcfg($remove($gettok($1,1,93),[),$gettok($1,2,93))
- elseif (%.cv.bit == !) return $_maprev($_rchop(1,$1))
- else return % [ $+ [ $1 ] ]
- }
- _conset {
- if ($1 == ?) return
- set %.cv.bit $left($1,1)
- if (%.cv.bit == $chr(35)) {
- if ($2) .enable $1
- else .disable $1
- }
- elseif (%.cv.bit == [) _writecfg $remove($gettok($1,1,93),[) $gettok($1,2,93) $2-
- elseif (%.cv.bit == !) return
- else set % [ $+ [ $1 ] ] $2-
- if ($1 == [Sound]LeechCmd) {
- set %leech.cmd.mask $_ppcfg(Sound,LeechCmd) *
- if (%leech.cmd.mask == *) unset %leech.cmd.mask
- }
- elseif (($1 == +pager.here) && (%_away.why == $null)) set %+pager %+pager.here
- }
- _consel {
- if ($1 < 3) return
- set %.c.sel $readini -n %_c.file %_c.topic $_j($1)
- set %.c.sel $replace(%.c.sel,*,%_c.sft)
- set %.c.1 $gettok(%.c.sel,1,32)
- if (%.c.1 == ?C) { window -c @Config | ctcpedit | halt }
- if (%.c.1 == ?O) { window -c @Config | colors | halt }
- if (%.c.1 == ?H) { window -c @Config | schemes | halt }
- if (%.c.1 == ?V) { window -c @Config | fonts | halt }
- if (%.c.1 == ?D) { window -c @Config | elements | halt }
- set %.c.2 $gettok(%.c.sel,2,32)
- set %.c.bit $left(%.c.1,1)
- if (%.c.bit == -) return
- if (%.c.bit == M) { _config %.c.2 | return }
- if (%.c.bit isin YNO) {
- if ($2 == ) _conset %.c.2 $_o2tf(%.c.1)
- elseif ($_conval(%.c.2)) _conset %.c.2 $false
- else _conset %.c.2 $true
- }
- elseif ($2 == ) {
- if (%.c.bit isin TDK) _conset %.c.2 $_rchop(1,%.c.1)
- elseif (%.c.bit isnum) _conset %.c.2 %.c.1
- elseif (%.c.1 == Z) {
- if ($3 == f) _conset %.c.2 $_ppdef2($remove($gettok(%.c.2,1,93),[),$gettok(%.c.2,2,93))
- else _conset %.c.2 $_ppdef($remove($gettok(%.c.2,1,93),[),$gettok(%.c.2,2,93))
- }
- elseif ((%.c.1 == ?S) || (%.c.1 == ?Z) || (%.c.1 == ?X)) _conset %.c.2
- elseif (%.c.1 == ?F) _setfld 20 5 8 40 2 5 30 3 5 15 0 6 40 2 4 15 6 18 8 11 15 250 450 on 350 30 3 0
- else { set %.c.def $readini -n %_c.file %.c.2 def | _conset %.c.2 $readini -n %_c.file %.c.2 %.c.def }
- }
- else {
- if (((%.c.bit == T) && ($2 == $null)) || ((%.c.bit isnum) && ($2 !isnum))) {
- set %_arhelp _consel $1
- _pentry _arhelp $+ $_s2p($_conval(%.c.2)) $gettok(%.c.sel,3-,32)
- }
- if (%.c.1 == ?S) {
- set %.c.qu " $+ $gettok(%.c.sel,3-,32) $+ "
- if (sound isin %.c.qu) set %.c.dir $wavedir $+ *.wav
- else set %.c.dir c:\*.exe
- _timer924off
- set %.c.got $dir= [ $+ [ %.c.qu ] ] %.c.dir
- _timer924on
- if ((%.c.got == $null) || (* isin %.c.got)) return
- _conset %.c.2 $remove(%.c.got,$mircdir)
- }
- elseif (%.c.1 == ?F) {
- if ($2 == $null) {
- window -c @Option
- window -l @Option $_winpos(20%,20%,23%,23%) @Option %font.basic
- titlebar @Option - $gettok(%.c.sel,3-,32)
- aline @Option (double-click to select)
- aline @Option %=
- aline @Option Tight CTCP flood protection
- aline @Option Normal CTCP flood protection
- aline @Option Low CTCP flood protection
- aline @Option No CTCP flood protection
- set %_c.optsel _consel $1
- set %_c.optcat color
- halt
- }
- if ($2 == 1) _setfld 20 3 6 40 1 4 30 2 5 20 0 5 40 0 4 20 5 40 5 10 20 200 450 on 300 25 2 0
- elseif ($2 == 2) _setfld 20 5 8 40 2 5 30 3 5 15 0 6 40 2 4 15 6 18 8 11 15 250 450 on 350 30 3 0
- elseif ($2 == 3) _setfld 10 6 8 20 4 6 15 4 6 10 0 6 20 2 4 10 6 15 9 11 12 350 600 on 400 35 5 0
- else _setfld 1 99 99 1 99 99 1 99 99 1 0 99 1 99 99 1 99 1 99 99 1 9999 9999 off 0 0 0 0
- }
- elseif ((%.c.1 == ?Z) || (%.c.1 == ?X)) {
- if ($2 == $null) {
- window -c @SoundDirs
- window -l @SoundDirs $_winpos(19%,19%,20%,20%) @SoundDirs %font.basic
- if (%.c.2 == ?) { set %_c.optsel ? | aline @SoundDirs - Double-click to modify options for a type, right-click to delete an entry - }
- elseif (! isin %.c.2) { set %_c.optsel ! | aline @SoundDirs - Double-click to modify extension, right-click to delete an extension - }
- else { set %_c.optsel _consel $1 | aline @SoundDirs - Double-click to modify a directory, right-click to delete an entry - }
- set %_c.val $_conval(%.c.2)
- aline @SoundDirs $chr(160)
- set %.nm $_numtok(59,%_c.val)
- if (%.nm > 0) {
- set %.cr 1
- :leep
- aline @SoundDirs $gettok(%_c.val,%.cr,59)
- if ($_vi(.cr) <= %.nm) goto leep
- }
- aline @SoundDirs (addánewáentry)
- halt
- }
- _conset %.c.2 $2-
- }
- elseif (%.c.bit == Z) {
- if ($2 == $null) {
- window -c @Option
- window -l @Option $_winpos(20%,20%,23%,23%) @Option %font.basic
- titlebar @Option - $gettok(%.c.sel,3-,32)
- aline @Option (double-click to select)
- aline @Option %=
- aline @Option Enter new message
- aline @Option Use file for random messages
- aline @Option Use default message
- set %_c.optsel _consel $1
- set %_c.optcat color
- halt
- }
- if ($2 == 1) {
- if ($3 == $null) {
- set %.c.v $_conval(%.c.2)
- set %_arhelp _consel $1 1
- if ($left(%.c.v,8) == !Random:) _askr _arhelp New message to use? (see help for usage of &codes&)
- else _pentry _arhelp $+ $_s2p($replace(%.c.v,,ü)) New message to use? (see help for usage of &codes&)
- }
- else set %.c.new $3-
- }
- elseif ($2 == 2) {
- _timer924off
- set %.c.got $dir="File to select random replies from?" [ [ $mircdir ] $+ ] *.txt
- _timer924on
- if ((%.c.got == $null) || (* isin %.c.got)) return
- set %.c.new !Random: $+ $remove(%.c.got,$mircdir)
- }
- elseif ($2 == 3) set %.c.new $_ppdef($remove($gettok(%.c.2,1,93),[),$gettok(%.c.2,2,93))
- _conset %.c.2 %.c.new
- }
- elseif ((%.c.bit isin DLK) && ($2 == $null)) {
- if (%.c.bit == D) set %.c.2 dcc
- window -c @Option
- window -l @Option $_winpos(20%,20%,23%,23%) @Option %font.basic
- titlebar @Option - $gettok(%.c.sel,3-,32)
- aline @Option (double-click to select)
- aline @Option %=
- if (%.c.bit == K) set %.c.max 16
- else set %.c.max $readini -n %_c.file %.c.2 num
- set %.c.num 1
- :loop
- if (%.c.bit == K) aline @Option $+ %.c.num $+ $_col2text(%.c.num)
- else {
- set %.c.opt $readini -n %_c.file %.c.2 %.c.num
- aline @Option $readini -n %_c.file %.c.2 $_iniprep(%.c.opt)
- }
- if ($_vi(.c.num) <= %.c.max) goto loop
- set %_c.optsel _consel $1
- if (%.c.bit == K) set %_c.optcat color
- else set %_c.optcat %.c.2
- halt
- }
- else _conset %.c.2 $2-
- }
- rline @Config $1 $_condisp(%.c.sel)
- }
- _conopt if ($1 < 3) return | window -c @Option | if (%_c.optcat == color) %_c.optsel $calc($1 - 2) | else %_c.optsel $readini -n %_c.file %_c.optcat $calc($1 - 2)
- _sdirclk {
- if ($1 < 3) return
- set %_sndchange y
- set %.it $line(@SoundDirs,$1)
- set %_arhelp _sdirclk $1
- if (%_c.optsel == !) {
- if ($1 == $line(@SoundDirs,0)) {
- if ($2 == $null) _askr _arhelp New file extension?
- iline @SoundDirs $1 $remove($2,.)
- set %soundfile.extmap1 %soundfile.extmap1 $remove($2,.)
- set %soundfile.extmap2 %soundfile.extmap2 $line(@SoundDirs,3)
- }
- elseif ($1 == 3) _error You cannot delete or modify the main (first) extension as it is used to define the sound file type
- elseif ($2 == $chr(160)) {
- dline @SoundDirs $1
- set %.pos $findtok(%soundfile.extmap1,%.it,32)
- set %.egg $_numtok(32,%soundfile.extmap1)
- unset %.toget2
- if (%.pos == 1) set %.toget1 2-
- elseif (%.pos == %.egg) set %.toget1 1- $+ $_j(%.egg)
- else { set %.toget1 1- $+ $_j(%.pos) | set %.toget2 $_i(%.pos) $+ - $+ %.egg }
- if (%.toget2 == $null) {
- set %soundfile.extmap1 $gettok(%soundfile.extmap1,%.toget1,32)
- set %soundfile.extmap2 $gettok(%soundfile.extmap2,%.toget1,32)
- }
- else {
- set %soundfile.extmap1 $gettok(%soundfile.extmap1,%.toget1,32) $gettok(%soundfile.extmap1,%.toget2,32)
- set %soundfile.extmap2 $gettok(%soundfile.extmap2,%.toget1,32) $gettok(%soundfile.extmap2,%.toget2,32)
- }
- }
- else {
- if ($2 == $null) _pentry _arhelp $+ %.it New file extension?
- rline @SoundDirs $1 $2
- set %soundfile.extmap1 $reptok(%soundfile.extmap1,%.it,$2,32)
- }
- return
- }
- elseif (%_c.optsel == ?) {
- if ($1 == $line(@SoundDirs,0)) {
- if ($2 == $null) _askr _arhelp File extension of new type? (Just one- you can add more file extensions later)
- iline @SoundDirs $1 $remove($2,.)
- set %soundfile.custom %soundfile.custom $remove($2,.)
- }
- elseif ($2 == $chr(160)) {
- dline @SoundDirs $1
- set %soundfile.custom $remtok(%soundfile.custom,%.it,32)
- }
- else { window -c @SoundDirs | config ? %.it }
- return
- }
- if ($2 == $chr(160)) set %.dir $2
- else {
- if ($1 == $line(@SoundDirs,0)) set %.dir c:\
- else { set %.dir $line(@SoundDirs,$1) | if ($right(%.dir,1) != \) set %.dir %.dir $+ \ }
- _timer924off
- set %.dir $sdir="Select a directory:" [ %.dir ]
- if ((%.dir == $null) || (* isin %.dir)) return
- }
- if ($1 == $line(@SoundDirs,0)) {
- if ($2 == $chr(160)) return
- iline @SoundDirs $1 %.dir
- if (%_c.val == $null) set %_c.val %.dir
- else set %_c.val %_c.val $+ ; $+ %.dir
- }
- else {
- if ($2 == $chr(160)) {
- dline @SoundDirs $1
- set %_c.val $remtok(%_c.val,%.it,59)
- if (%_c.val == $null) set %_c.val $chr(127)
- }
- else {
- rline @SoundDirs $1 %.dir
- set %_c.val $reptok(%_c.val ,%.it,%.dir,59)
- }
- }
- %_c.optsel %_c.val
- }
-